﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:base="clr-namespace:Flare.DB"
    xmlns:Controls="clr-namespace:Flare.Controls" x:Class="Flare.Pages.Endpoint.Create" 
    mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800">

    <UserControl.Resources>
        <ObjectDataProvider x:Key="NetListDataSet" ObjectType="{x:Type base:endpoints}" MethodName="Index" IsAsynchronous="False">
            <ObjectDataProvider.MethodParameters>
                <x:Null/>
                <x:Null/>
                <x:Null/>
                <x:Null/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="general_departmentsDataSet" ObjectType="{x:Type base:general_departments}" MethodName="Index" IsAsynchronous="False" />

        <ObjectDataProvider x:Key="general_roomsDataSet" ObjectType="{x:Type base:general_rooms}" MethodName="Index" IsAsynchronous="False">
            <ObjectDataProvider.MethodParameters>
                <x:Null/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="endpoint_typesDataSet" ObjectType="{x:Type base:endpoint_types}" MethodName="Index" IsAsynchronous="False"/>
    </UserControl.Resources>

    <DockPanel LastChildFill="False" VerticalAlignment="Top">
        <Controls:FlameMenu x:Name="Department" Caption="Отдел" SelectedValuePath="id_department" DisplayMemberPath="department" DockPanel.Dock="Top" 
                            ItemsSource="{Binding Source={StaticResource general_departmentsDataSet}}" SelectionChanged="Department_SelectionChanged" />

        <Controls:FlameMenu x:Name="Room" Caption="Кабинет" SelectedValuePath="id_room" DisplayMemberPath="room" DockPanel.Dock="Top"
                            ItemsSource="{Binding Source={StaticResource general_roomsDataSet}}" />

        <Controls:FlameMenu x:Name="netType" Caption="Тип" SelectedValuePath="id_type" ItemsSource="{Binding Source={StaticResource endpoint_typesDataSet}}" 
                            DockPanel.Dock="Top" DisplayMemberPath="type" />

        <Controls:FlameTbox x:Name="endpoint_name" Header="Наименование" DockPanel.Dock="Top" Margin="10,40,0,0" Width="577" />
        <Controls:FlameTbox x:Name="endpoint_ip" Header="IP адрес" DockPanel.Dock="Top" Margin="10,10,0,0" Width="373" />
        <Controls:FlameTbox x:Name="endpoint_phone" Header="Телефон" DockPanel.Dock="Top" Margin="10,10,0,0" Width="373" />

        <Controls:FlameButtonInfo x:Name="insertButton" Content="Добавить" HorizontalAlignment="Left" DockPanel.Dock="Top" Margin="10,40,0,0" 
                                  Click="insertButton_Click" />
    </DockPanel>
</UserControl>
